<phone:PhoneApplicationPage 
    x:Class="QuickTasks.Views.FavoritePeople.contacts"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True">
<phone:PhoneApplicationPage.Resources>
        <DataTemplate x:Key="contactsItemTemplate">
            <Grid>
                <StackPanel  VerticalAlignment="Top" Orientation="Horizontal">
                    <CheckBox  x:Name="chkContacts"  Width="60"  Tag="{Binding contactname}"  Checked="chkContacts_Checked" Unchecked="chkContacts_Unchecked"/>
                    <TextBlock x:Name="txtcontacts"  Margin="0,20,0,0" FontSize="26" Text="{Binding contactname}"/>
                </StackPanel>
            </Grid>
        </DataTemplate>


       
        <DataTemplate x:Key="groupHeaderTemplate" >
            <Border Background="Transparent"  Margin="12,4,10,8">
                <Border Background="{StaticResource PhoneAccentBrush}" 	
                                        Padding="8,0,8,0" Width="99" Height="99" 				 
                                        HorizontalAlignment="Left">

                    <TextBlock Text="{Binding Title}"   Foreground="#FFFFFF" 
                                               FontSize="38" 
                                               FontFamily="{StaticResource PhoneFontFamilySemiLight}"
                                               HorizontalAlignment="Center"
                                               VerticalAlignment="Center"/>
                    
                </Border>
            </Border>
           
        </DataTemplate>
            

        <DataTemplate x:Key="groupItemTemplate" >

            <Border Background="{StaticResource PhoneAccentBrush}" 
                                    Width="99" Height="99" Margin="6">
                <TextBlock Text="{Binding Title}" FontFamily="{StaticResource PhoneFontFamilySemiBold}"
                                           FontSize="48"
                                           Margin="8,0,0,0"
                                           Foreground="#FFFFFF"                                        
                                           VerticalAlignment="Bottom"/>
               
            </Border>

        </DataTemplate>
    </phone:PhoneApplicationPage.Resources>
    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="100"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle"  Text="QUICK TASKS - Import Contacts" Style="{StaticResource PhoneTextNormalStyle}"/>
          
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1">

            <phone:LongListSelector x:Name="listcontacts" Background="Transparent"  
                                       

                 ItemTemplate="{StaticResource contactsItemTemplate}"
                  
					GroupHeaderTemplate="{StaticResource groupHeaderTemplate}"
                   >
                
            </phone:LongListSelector>
        </Grid>
        <StackPanel Name="adstackpanel" Grid.Row="2" VerticalAlignment="Bottom" Margin="-15,32,0,0"></StackPanel>
    </Grid>
 
    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar.save.rest.png" Text="Import"  Click="ApplicationBarIconButton_Click"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       